﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Xyz.Web.Reservation.Models.BookingModel>" %>
<%@ Import Namespace="Xyz.Web.Reservation.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Addon Selection
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Addon Services</h2>
<% using (Html.BeginForm("Addon", "Shoppingcart", FormMethod.Post, new { id = "addonForm", enctype = "multipart/form-data" }))
       {%>
    <%: Html.ValidationSummary(true) %>
   
        
             <fieldset>
        <legend>Addon Information</legend>
         

                     
         <% 
            for (int i = 0; i < Model.Tickets.Count; i++) %>
        <% { %>
         <fieldset>
                <table style="width: 100%; border: 1;border-collapse: collapse">
         <tr align="left">
          <td>
          <b>
          <% if (Model.Tickets[i].isDeparture == true)
              {%> Departure Flight
           <% }
              else
              { %>
            Return Flight
            <%} %>
            </b>
          </td>
          <td>
            <b>
                Passenger Name
            </b>
          </td>
          <td>
            <b style="margin-left: 22px;">
                Extra Luggage
            </b>
          </td>
          <td>
            <b style="margin-left: 22px;">
                Meal
            </b>
          </td>
          <td>
            <b style="margin-left: 22px;">
                Insurance
            </b>
          </td>
          </tr>
        <tr>
                
            <td valign ="top">
              <%: Model.Tickets[i].Flight.FlightCode%>
            </td>
            <td valign ="top">   
              <%: string.Concat(Model.Tickets[i].Passenger.LastName, " ", Model.Tickets[i].Passenger.FirstName)%>
           </td>
            <!-- todo the label-->
                <td valign ="top">
                    <% foreach (ServiceModel luggService in (List<ServiceModel>)ViewData["LuggServices"])
                       {%>
                    
                    <%= Html.RadioButton("LuggService" + i, luggService.ServiceCode, false)%>
                    <%= luggService.ServiceDescription%>
                    <%= luggService.Price%>
                    <br/>
                    <% } %>
                     <br/>
                      <br/>
                </td>
                 
                <td valign ="top">
                    <% foreach (ServiceModel mealService in (List<ServiceModel>)ViewData["MealServices"])
                       {%>
                    <%= Html.RadioButton("MealService" + i, mealService.ServiceCode, false)%>
                    <%= mealService.ServiceDescription%>
                    <%= mealService.Price%>
                     <br/>
                    <% } %>
                     <br/>
                      <br/>
                     
                </td>
                <td valign ="top">
                    <% foreach (ServiceModel insuService in (List<ServiceModel>)ViewData["InsuServices"])
                       {%>
                    <%= Html.RadioButton("InsuService" + i, insuService.ServiceCode, false)%>
                    <%= insuService.ServiceDescription%>
                    <%= insuService.Price%>
                     <br/>
                    <% } %>
                     <br/>
                      <br/>
                </td>
        </tr>
          </table>
            </fieldset>
        <% } %>
  
            <input type="submit" value="   Next   " class="yellow_button" />
      &nbsp;&nbsp;
      <input type="button" value="   Reset   " onclick="resetForm()" class="yellow_button" />

        </fieldset>
        <br />
        <br />
     <% } %>

     <script type="text/javascript">
         function resetForm() {
            $("#addonForm").find('input:text, input:password, input:file, select').val('');
            $("#addonForm").find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');
         }
    </script>
    
   

</asp:Content>
